package gameFrame;
import javax.imageio.ImageIO;
import java.awt.*;
import java.io.IOException;
import java.net.URL;
//工具类
public class GameUtil02 {

    public static final int FRAME_WIDTH = 500;
    public static final int FRAME_HIGHT = 500;
   //私有工具类，防止外部创建对象
    private GameUtil02(){}

    public static Image getImage(String path)  {
        Image img = null;
        URL url = GameUtil02.class.getClassLoader().getResource(path);
       // Image img = ImageIO.read(url);
       try {
            img = ImageIO.read(url);
       }catch (IOException e){
           e.printStackTrace();
       }
       return img;
    }
}
